﻿using Autofac;
using MahApps.Metro.Controls;
using PLCWpfTest.Models;
using PLCWpfTest.ViewModels;
using YWM;

namespace PLCWpfTest.Views
{
    /// <summary>
    /// VariableSettingWindow.xaml 的交互逻辑
    /// </summary>
    public partial class ParameterUpdateWindow : MetroWindow
    {
        public ParameterUpdateWindow(ParameterModel parameter)
        {
            InitializeComponent();
            ParameterUpdateViewModel parameterUpdateViewModel = YApp.Resolve<ParameterUpdateViewModel>(new NamedParameter("parameter", parameter));
            parameterUpdateViewModel.RequestClose += ParameterUpdateViewModel_RequestClose;
            DataContext = parameterUpdateViewModel;
        }

        private void ParameterUpdateViewModel_RequestClose()
        {
            Close();
        }
    }
}
